import request from '@/utils/request'

/**
 * 分页获取
 */
export function getUserInfoByPage(params, pageNum, pageSize, token) {
    return request({
        url: '/userInfo/list/page',
        method: 'get',
        params: {
            ...params,
            pageNum,
            pageSize,
        },
        headers: {
            'token': token
        }
    })
}

/**
 * 保存
 */
export function addOrUpdateUserInfo(data, token) {
    return request({
        url: '/userInfo/addOrUpdate',
        method: 'post',
        data:data,
        headers: {
            'token': token
        }
    })
}

/**
 * 用户信息详情
 */
export function getUserInfoDetail(id, token) {
    return request({
        url: '/userInfo/getUserInfoDetail/' + id,
        method: 'get',
        headers: {
            'token': token
        }
    })
}

/**
 * 删除用户信息
 */
export function delUserInfoById(id, token) {
    return request({
        url: '/userInfo/delUserInfoById/' + id,
        method: 'post',
        headers: {
            'token': token
        }
    })
}